<template>
  <el-dialog v-bind="$attrs" v-on="$listeners">
    <el-input v-model="value2"></el-input>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleClose">取 消</el-button>
      <el-button type="primary" @click="handleSubmit" :loading="submitLoading"
        >确 定</el-button
      >
    </div>
  </el-dialog>
</template>

<script>
export default {
  props: {
    ok: {
      type: Function,
      default: () => {
        this.handleClose();
      },
    },
  },
  data() {
    return {
      submitLoading: false,
      value2: 10,
    };
  },
  methods: {
    handleClose() {
      this.$emit("input", false);
    },

    handleSubmit() {
      this.submitLoading = true;
      this.ok().finally(() => {
        this.submitLoading = false;
        this.handleClose();
      });
    },
  },
};
</script>
<style lang="scss" scoped></style>
